// axios 公共配置
// 基地址
axios.defaults.baseURL = 'http://geek.itheima.net'


axios.interceptors.request.use(function (config) {
    const token = localStorage.getItem('token')
    token && (config.headers.Authorization = `Bearer ${token}`)
    return config
})

axios.interceptors.response.use(function (response) {
    return response.data;
}, function (error) {
    console.dir(error)
    return Promise.reject(error)
});